<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.hongye.app.model.MenuModel"%>
<%@page import="com.hongye.app.model.AuthorModel"%>
<%@page import="com.hongye.app.model.RoleModel"%>
<%@page import="java.util.List"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html class="fixed">
	<head>
		<!-- Basic -->
		<meta charset="UTF-8">
		<title id = "title" >热播购—后台管理系统</title>
		<meta name="keywords" content="热播购" />
		<meta name="description" content="热播购,购物网站">
		<meta name="author" content="www.rebogou.com">
		<link rel="shortcut icon" href="http://example.com/favicon.ico" type="image/vnd.microsoft.icon">
		<link rel="icon" href="img/logo.png" type="image/vnd.microsoft.icon">
		<!-- Mobile Metas -->
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<!-- Web Fonts  -->
		<!-- Vendor CSS -->
		<link rel="stylesheet" href="css/bootstrap.css" />
		<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css" />
		<!-- Theme CSS -->
		<link rel="stylesheet" href="css/theme.css" />
		<!-- Skin CSS -->
		<link rel="stylesheet" href="css/default.css" />
		<!-- Theme Custom CSS -->
		<script src="js/modernizr.js"></script>
	</head>
	<body STYLE='OVERFLOW:SCROLL;OVERFLOW-Y:HIDDEN'>
		<header class="header">
			<div class="logo-container">
				<a href="../" class="logo">
					<img src="img/48.png" height="35" alt="Admin" />
				</a>
				<div class="visible-xs toggle-sidebar-left" data-toggle-class="sidebar-left-opened" data-target="html" data-fire-event="sidebar-left-opened">
					<i class="fa fa-bars" aria-label="Toggle sidebar"></i>
				</div>
			</div>
		</header>
		<aside id="sidebar-left" class="sidebar-left">
			<div class="nano">
				<div class="nano-content">
					<nav id="menu" class="nav-main" role="navigation">
						<ul class="nav nav-main">
							<li class="nav-parent">
								<a>
									<i class="fa fa-align-left" aria-hidden="true"></i>
									<span>系统后台</span>
								</a>
								<%List<MenuModel> menulist=(List)request.getAttribute("menulist");
											for(int i=1;i<=menulist.size();i++){
												MenuModel mm=menulist.get(i-1);
												if(mm.getInt("pid")<10){
											%>
								<ul class="nav nav-children">
									<li class="nav-parent">
										<a href="#" onclick="menushow(this);" data-name="<%=mm.get("menu_name") %>"> <%=mm.get("menu_name") %></a>
										<%
										for(int k=1;k<=menulist.size();k++){
											MenuModel mm2=menulist.get(k-1);
											if(mm2.getInt("pid")>(mm.getInt("pid")*10)&&mm2.getInt("pid")<((mm.getInt("pid")+1)*10)){
										%>
										<ul class="nav nav-children">
											<li  ><a href="#" onclick="menushow(this);" data-name="<%=mm2.get("menu_name") %>"><%=mm2.get("menu_name") %></a></li>
										</ul>
										<%} }%>
									</li>
								</ul>
								<%} }%>
							</li>
						</ul>
					</nav>
				</div>
			</div>
		</aside>
		<div class="embed-responsive embed-responsive-16by9">
			<%List<MenuModel> menulist2=(List)request.getAttribute("menulist");
				for(int i=1;i<=menulist2.size();i++){
					MenuModel mm2=menulist2.get(i-1);
					if(mm2.get("menu_url")!=null){
				%>
			<div style="display:none"  class="tab-pane <%=mm2.get("menu_name") %>" id="lA"><iframe id="<%=mm2.get("menu_name") %>" class="embed-responsive-item " ifname="<%=mm2.get("menu_name") %>" src="<%=mm2.get("menu_url") %>"></iframe></div>
					<%}else{ %>
			<div style="display:none"  class="tab-pane <%=mm2.get("menu_name") %>" id="lA"><iframe id="<%=mm2.get("menu_name") %>" class="embed-responsive-item " ifname="<%=mm2.get("menu_name") %>" ></iframe></div>
						<%}%>
		    <div style="display:none" class="tab-pane" id="la"><iframe id="lala" class="embed-responsive-item" src=""></iframe></div>
		   		 <%}%>
		</div>
		<script src="js/jquery.js"></script>
		<!-- Specific Page Vendor -->
		<!-- Theme Base, Components and Settings -->
		<script src="js/theme.js"></script>
		<!-- Theme Custom -->
		<script src="js/theme.custom.js"></script>
		<!-- Theme Initialization Files -->
		<script src="js/theme.init.js"></script>
		<!-- Examples -->
		<script src="js/examples.dashboard.js"></script>
		<script type="text/javascript">
		$(function(){
			$('#lala').attr('src','../goods/goodsReview');
			$('#la').css('display','block');
		});
		function menushow(obj){
			var menuText = obj.getAttribute("data-name");
			var name = $("#"+menuText).attr("ifname");
			var src = $("#"+menuText).attr('src');
			// 按照规律添加菜单就可以了。
			if(src!=null){
			if($("."+menuText).css("display")=="none"){
				$(".tab-pane").css('display','none');
				$("."+menuText).css('display','block');
				}
			 $("#"+menuText).attr('src',src);
			}
		}
			
		</script>
	</body>
</html>